package com.opsad.niceread.utils;

import android.app.ActivityManager;
import android.content.Context;
import android.util.Log;

import java.util.ArrayList;

public class AdbUtil {
    private final static String TAG = AdbUtil.class.getSimpleName();


    /**
     * 把自己的acitivity显示到前台
     */
    public static void printTaskActivitys(Context ctx){
        ActivityManager mActivityManager = (ActivityManager) ctx.getSystemService(Context.ACTIVITY_SERVICE);
        ArrayList<ActivityManager.RunningTaskInfo> appRunningTasks= (ArrayList<ActivityManager.RunningTaskInfo>)
                mActivityManager.getRunningTasks(100);

        for (ActivityManager.RunningTaskInfo taskInfo : appRunningTasks){
            String activityName =  taskInfo.baseActivity.getClassName();
            Log.i(TAG,"activityName:" + activityName);
//            if (activityName.equals(wantActivityName)){
//                Lg.i(TAG,"wantActivityName:" + wantActivityName);
//                mActivityManager.moveTaskToFront(taskInfo.id, 0);
//            }
        }
    }


}
